package com.hps.springboot.exception;

import com.hps.springboot.pojo.ResponseBody;
import org.springframework.web.bind.annotation.*;

@ControllerAdvice
public class ExceptionHandler {

    @org.springframework.web.bind.annotation.ExceptionHandler(value = {GirlException.class})
    @org.springframework.web.bind.annotation.ResponseBody
    public ResponseBody handle(Exception e) {
        ResponseBody responseBody = new ResponseBody();
        responseBody.setCode(100);
        responseBody.setMsg(e.getMessage());
        return responseBody;
    }
}
